<!-- easyui部分 -->

<link rel="stylesheet" href="../../../assets/libs/easyui/css/easyui.css">
<link rel="stylesheet" href="../../../assets/libs/easyui/css/icon.css">
<link rel="stylesheet" href="../../../assets/libs/easyui/css/demo.css">
<script src="../../../assets/libs/easyui/js/jquery.easyui.min.js"></script>

<!-- Ztree树部分 -->
<link rel="stylesheet" href="../../../assets/libs/ztree/css/zTreeStyle/zTreeStyle.css"/>
<script src="../../../assets/libs/ztree/js/jquery.ztree.core.min.js"></script>
<script src="../../../assets/libs/ztree/js/jquery.ztree.exedit.js"></script>
<script src="../../../assets/libs/ztree/js/jquery.ztree.excheck.min.js"></script>
<script src="../../../assets/libs/copy/clipboard.min.js"></script>

<link rel="stylesheet" href="../../../assets/css/region/regionManage.css">

<div class="layui-card-header">行政区划管理</div>
<div class="layui-card-body">
    <div id="regionmanage-tmpl-box"></div>
    <table id="regionManageTreeTable" style="width:100%;height:400px"></table>
</div>


<!--新增弹窗-->
<script type="text/html" id="addRegionManage">
    <form id="regionForm" lay-filter="regionForm" class="layui-form model-form">
        <div class="layui-form-item">
            <label class="layui-form-label">区划名称</label>
            <div class="layui-input-block">
                <input name="name" placeholder="" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required"  />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">区划简称</label>
            <div class="layui-input-block">
                <input name="shortName" placeholder="" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify=""  />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">区划编码</label>
            <div class="layui-input-block">
                <input name="code" placeholder="" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify=""  />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">上级区划</label>
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-primary" type="button" id="parentRegionName" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</button>
                <ul id="RegionTree" class="ztree" ></ul>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">x坐标</label>
            <div class="layui-input-block">
                <input name="x" placeholder="x坐标" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips"  />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">y坐标</label>
            <div class="layui-input-block">
                <input name="y" placeholder="y坐标" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">城乡分类代码</label>
            <div class="layui-input-block">
                <input name="urcCode" placeholder="城乡分类代码" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">乡属性代码</label>
            <div class="layui-input-block">
                <input name="ruralProperty" placeholder="项属性代码" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips"  />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">村属性代码</label>
            <div class="layui-input-block">
                <input name="villageProperty" placeholder="村属性代码" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">行政区划类型</label>
            <div class="layui-input-block">
                <select name="regionCodeType" lay-filter="" id="addRegionCodeTypeBox">

                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">原点区划</label>
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-primary" type="button" id="orgionRegionName" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</button>
                <ul id="orgionRegionTree" class="ztree" ></ul>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <textarea name="memo" placeholder="" class="layui-textarea" maxlength="20"
                          lay-verType="tips" />
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="regionEditSubmit" lay-submit>确定</button>
        </div>
    </form>
</script>
<!--渲染区划配置权限-->
<script type="text/tmpl" id="regionmanage-tmpl">
    <div class="layui-form toolbar">
        <div class="layui-form-item">
            <div class="layui-inline">
                {{ if hasPower("/region/regionManage:regionImport")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="import-btn-orgionRegion">
                    <i class="layui-icon">&#xe62f;</i>导入区划树
                </button>
                {{/if}}
                {{ if hasPower("/region/regionManage:regionUpdate")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="change-region-btn">
                    <i class="layui-icon">&#xe669;</i>重大区划变更
                </button>
                {{/if}}
                {{ if hasPower("/region/regionManage:add")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="add-btn-template-regionManage" >
                    <i class="layui-icon">&#xe654;</i>新增
                </button>
                {{/if}}
                {{ if hasPower("/region/regionManage:add")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="edit-btn-regionManage" >
                    <i class="layui-icon">&#xe642;</i>编辑
                </button>
                {{/if}}
                {{ if hasPower("/region/regionManage:add")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="delete-btn-regionManage" >
                    <i class="layui-icon">&#xe640;</i>删除
                </button>
                {{/if}}
            </div>
        </div>
    </div>
  </script>
<!-- 分组表格操作列DOM -->
<script id="tableBarAuth">
</script>
<!-- 指标管理表格操作列 -->
<script type="text/tmpl" id="tableBarAuth-tmp">
    {{ if hasPower("/micro/template-idenManage:edit")}}
    <a class="layui-btn layui-btn-xs layui-btn-warning" lay-event="edit">编辑</a>
    {{/if}}
    {{ if hasPower("/micro/template-idenManage:delete")}}
    <a class="layui-btn layui-btn-danger layui-btn-xs micro-ident-group-delete" lay-event="delete">删除</a>
    {{/if}}
</script>

<!--区划变更弹窗-->
<script type="text/html" id="RegionChangeModel">
    <div class="layui-row regionChangeModelContent">
        <div class="layui-col-md4">
            <p class="title">行政区划树</p>
            <form id="regionChangeForm" lay-filter="regionChangeForm" class="layui-form model-form">
                <div class="layui-form-item">
                    <label class="layui-form-label">当前区划</label>
                    <div class="layui-input-block">
                        <button class="layui-btn layui-btn-primary" type="button" id="changeRegionName" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</button>
                        <ul id="changeRegionTree" class="ztree" ></ul>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">变更类型</label>
                    <div class="layui-input-block">
                        <select name="changetype" lay-filter="" id="changetypebox" lay-verify="required">

                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">描述信息</label>
                    <div class="layui-input-block">
                        <textarea name="memo" placeholder="" class="layui-textarea" maxlength="20"
                                  lay-verType="tips" />
                    </div>
                </div>

                <div class="layui-form-item text-right submit-box">
                    <button class="layui-btn layui-btn-primary" type="button" ew-event="closePageDialog">取消</button>
                    <button class="layui-btn" lay-filter="regionChangeSubmit" lay-submit>区划变更</button>
                </div>
            </form>
        </div>
        <div class="layui-col-md8">
            <p class="title">变更信息</p>
            <table class="layui-table" id="regionChangeTable" lay-filter="regionChangeTable"></table>
        </div>
    </div>


</script>

<script type="text/tmpl" id="region-type-tmpl">
{{each regionType}}
    <option value="{{$value.value}}">{{$value.regionType}}</option>
{{/each}}
</script>

<script type="text/tmpl" id="region-changetype-tmpl">
{{each data}}
    <option value="{{$value.value}}">{{$value.changeType}}</option>
{{/each}}
</script>
<!-- 分组表格操作列DOM -->
<script type="text/html" id="region-change-table-template-box">
    <a class="layui-btn layui-btn-danger layui-btn-xs micro-ident-group-delete" lay-event="deleteChange">删除</a>
</script>
<script src="../../../assets/js/region/regionManage/regionManage.js"></script>



